#include <stdio.h>
void swap1(int *pa, int *pb)
{
    int tmp = *pa;
    *pa     = *pb;
    *pb = tmp;
}
void swap2(int *pa, int *pb) 
{
    *pa += *pb;
    *pb  = *pa - *pb;
    *pa -= *pb;
}
void swap3(int *pa, int *pb)
{
    *pa *= *pb;
    *pb  = *pa / *pb;
    *pa /= *pb;
}
void swap4(int *pa, int *pb)
{
    *pa ^= *pb;
    *pb ^= *pa;
    *pa ^= *pb;
}
int main()
{
    int a0 = 3;
    int b0 = 4;

    printf("before swap1: a0: %d, b0: %d\n", a0, b0);
    swap1( &a0, &b0);
    printf("after swap1: a0: %d, b0: %d\n", a0, b0);

    int a1 = 10;
    int b1 = 22;

    printf("before swap2: a1: %d, b1: %d\n", a1, b1);
    swap2( &a1, &b1);
    printf("after swap2: a1: %d, b1: %d\n", a1, b1);

    int a2 = -243;
    int b2 = 829;

    printf("before swap3: a2: %d, b2: %d\n", a2, b2);
    swap3( &a2, &b2);
    printf("after swap3: a2: %d, b2: %d\n", a2, b2);


    int a3 = 934;
    int b3 = -234;

    printf("before swap4: a3: %d, b3: %d\n", a3, b3);
    swap4( &a3, &b3);
    printf("after swap4: a3: %d, b3: %d\n", a3, b3);

    return 0;
}